package com.changhong.wlyspectrum.utils;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.RelativeLayout;

import com.changhong.wlyspectrum.R;

public class MyEditText extends RelativeLayout {
    
    private Context mContext;
    private EditText mEditText;



    public MyEditText(Context context, AttributeSet attrs) {
          super(context, attrs);
          this.mContext= context;
          init();
         
    }

    public void init() {
          LayoutInflater inflater = LayoutInflater.from(mContext);
          View view = inflater.inflate(R.layout.myedit_text,this);
          mEditText= (EditText) view.findViewById(R.id.my_descri);
    }

    


    @Override
    protected void onFinishInflate() {
          super.onFinishInflate();

    }

    /**
     *@description
     *@return
     */
    public boolean isEmpty() {
          return getText() ==null|| getText().length() == 0 ?true:false;
    }

    /**
     *@description
     *@return
     */
    public String getText() {
          return mEditText.getText().toString();
    }

    /**
     *@description
     *@return
     */
    public void setText(String s) {
          mEditText.setText(s);
    }
}
